package com.zcs.order.controller;

import com.zcs.order.service.DouyinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author zhangchunsheng
 * @version 1.0.0
 * @className testController
 * @date 2024/11/7   21:45
 * @description TODO
 */
@RestController
public class testController {

    @Autowired
    DouyinService douyinService;
//    @Value("${spring.datasource.url}")
//    private String url;

    //读取配置中心的参数
//    @Value("${sysconfig.isDebug}")
//    @Value("${tsconfig}")
//    private boolean isDebug;
//
//
//    @RequestMapping("test/page1")
//    public String page1(){
//        return "getway page1. current time:"+(new Date()).toString();
//    }

//    @RequestMapping("test/page2")
//    public String page2(){return "getway page2.sysconfig.isDebug="+isDebug.toString();}

    @RequestMapping("getcode")
    public void page1(@RequestHeader(value = "Truth",required = false) String truth){
        System.out.println(truth);
//        douyinService.getCode();
    }

    @RequestMapping("getToken")
    public void getToken(){
        douyinService.getToken(new String());
    }

    @RequestMapping("callback")
    public void callback(HttpServletRequest request){
        String code = request.getParameter("code");
        System.out.println(code);
    }
}